package com.lehecai.ucenter.servlet.monitor;

import com.lehecai.core.servlet.CoreBaseServlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by likunpeng on 2014/6/10.
 */
public class PingServlet extends CoreBaseServlet {
    private static final long serialVersionUID = 1039196368991804375L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        StringBuffer sb = new StringBuffer();
        sb.append(MonitorConstant.CODE+"="+MonitorMessage.OK.errorCode);
        sb.append(MonitorConstant.LINEBREAK);
        sb.append(MonitorConstant.STATUS+"="+MonitorMessage.OK.status);
        sb.append(MonitorConstant.LINEBREAK);
        sb.append(MonitorConstant.PROJECT+"="+MonitorConstant.SYSTEM);
        sb.append(MonitorConstant.LINEBREAK);
        sb.append(MonitorConstant.MESSAGE+"="+MonitorMessage.OK.message);
        writeRs(response, sb.toString());
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doGet(request, response);
    }
}
